package main

import (
	"server/base"
	"server/base/db"
	"server/base/redis"

	"github.com/BurntSushi/toml"
)

type EthOption struct {
	Endpoint string `json:"endpoint"`
}

type Config struct {
	Mysql []*db.Config    `json:"mysql"`
	Redis []*redis.Config `json:"redis"`
}

func LoadConfigFile(tomlfile string) *Config {
	config := Config{}
	_, err := toml.DecodeFile(tomlfile, &config)
	base.Raise(err)
	return &config
}
